Page({
  data: {
    week: ['日', '一', '二', '三', '四', '五', '六'],
    month: []
  },
  onLoad(){
    let date = new Date('2019-11-1');

    let month = this.getMonth('2019', '11');
    for(var i = 0;i < month; i ++){
      this.data.month.push({
        text: i + 1
      });
    }

    for(var e = 0;e < date.getDay(); e ++){
      this.data.month.unshift({});
    }
    this.setData({
      month: this.data.month
    });  
  
  },
  onShareAppMessage(){
    
  },

  getMonth(year, month){
    if(!year && !month){
      let date = new Date();
      year = date.getFullYear(),
      month = date.getMonth() + 1;
    }

    let months = new Date(year, month, 0);

    return months.getDate();
  }
})